import h5py

# 打开文件
file_path = 'data/nyc.h5'
with h5py.File(file_path, 'r') as f:
    # 打印文件中的所有键（顶层结构）
    print("Keys in the file:")
    for key in f.keys():
        print(f" - {key}")

    # 遍历每个键，打印其形状和数据类型
    for key in f.keys():
        data = f[key]
        print(f"\nDataset: {key}")
        print(f"Shape: {data.shape}")
        print(f"Dtype: {data.dtype}")
